import React from 'react'
import AbstratClass from './components/AbstratClass'
import FunctionReload from './components/FunctionReload'
type Props = {}

//输出10-100之间的所有素数
for (let i = 10; i <= 100; i++) {
  let count: number = 0
  for (let j = 1; j <= i; j++) {
    if (i % j == 0) {
      count++
    }
  }
  if (count == 2) {
    console.log(i)
  }
}

//7、1，2，3，4四个数字,能组合成多少种互不相同且没有重复的三位数
for (let i = 1; i <= 4; i++) {
  for (let j = 1; j <= 4; j++) {
    for (let k = 1; k <= 4; k++) {
      if (i !== j && i !== k && j !== k) {
        console.log(i * 100 + j * 10 + k)
      }
    }
  }
}

//取出四位数中的各个位上的数字
function fn(a: number): string {
  let gw = a % 10
  let sw = Math.floor((a / 10) % 10)
  let bw = Math.floor((a / 100) % 10)
  let qw = Math.floor(a / 1000)
  return `个位是${gw}十位是${sw}百位是${bw}千位是${qw}`
}
console.log(fn(1234))

const App = (props: Props) => {
  return (
    <div>
      <AbstratClass></AbstratClass>
      <FunctionReload></FunctionReload>
    </div>
  )
}

export default App
